/*
 * @Author: sjf 
 * @Date: 2021-12-07 14:11:55 
 * @Last Modified by: sjf
 * @Last Modified time: 2021-12-Tu 04:14:43
 */

import axios from 'axios'
import { message } from 'antd'
export function request (config) {

  //第二种配置方法
  const instance = axios.create({
    baseURL: '',
    timeout: 5000
  })

  instance.interceptors.request.use(config => {
    return config
  }, err => {
    console.log(err)
  })

  instance.interceptors.response.use(res => {
    console.log(res.data.data)
    return res.data
  }, err => {
    message.error("请求出错了" + err.message)
  })

  return instance(config)
}
